var scope = "global scope";
function checkscope(){
    var scope = "local scope";
    function f(){
        console.log('f')
        return scope;
    }
    console.log('----')
    return f;
}


// var scope = "global scope";
// function checkscope(){
//     var scope = "local scope";
//     function f(){
//         console.log('f')
//         return scope;
//     }
//     console.log('----')
//     return f();
// }

console.log(checkscope());
// console.log(checkscope()());
// checkscope()()